package com.lmx.repoDomain.tmodel;

import io.katharsis.resource.annotations.JsonApiIncludeByDefault;
import io.katharsis.resource.annotations.JsonApiResource;
import io.katharsis.resource.annotations.JsonApiToOne;

import javax.persistence.*;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

/**
 * 业务表 与 laorenleixing
 */
@Entity
@Table(name = "tnb_customer_businessflow_oldmantype")
@JsonApiResource(type = "flowoldmantype")
public class BusinessflowOldManType extends BaseEntity {
	private CustomerBusinessFlow flow;// 老人

	private Dicttype oldManType;// 类型

	private String remark;// 备注

	@JsonApiToOne
	// @JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.JOIN)
	@JoinColumn(name = "flow_id", foreignKey = @ForeignKey(name = "null"))
	public CustomerBusinessFlow getFlow() {
		return flow;
	}

	public void setFlow(CustomerBusinessFlow flow) {
		this.flow = flow;
	}

	@JsonApiToOne
	@JsonApiIncludeByDefault
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.JOIN)
	@JoinColumn(name = "oldtype_id", foreignKey = @ForeignKey(name = "null"))
	public Dicttype getOldManType() {
		return oldManType;
	}

	public void setOldManType(Dicttype oldManType) {
		this.oldManType = oldManType;
	}

	@Column(name = "remark")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
}